1400 |
Is it possible to define my values for sorting
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"C1")))->PutSortType(EXG2ANTTLib::SortUserDataString); spG2antt1->GetColumns()->Add(L"C2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Cell 1"); var_Items->PutCellData(h,long(0),"3.your extra data"); var_Items->PutCellValue(h,long(1),"SortValue=3"); h = var_Items->AddItem("Cell 1.1"); var_Items->PutCellData(h,long(0),"1.your extra data"); var_Items->PutCellValue(h,long(1)," SortValue=1"); h = var_Items->AddItem("Cell 1.2"); var_Items->PutCellData(h,long(0),"5.your extra data"); var_Items->PutCellValue(h,long(1)," SortValue=5"); h = var_Items->AddItem("Cell 1.3"); var_Items->PutCellData(h,long(0),"2.your extra data"); var_Items->PutCellValue(h,long(1)," SortValue=2"); |
1399 |
I have multiple dropdown lists, that are depending on each other, that means that the values in dropdown list no. 2 is based on the users selection in dropdown list no 1. How can I do this
// EditOpen event - Occurs when the edit operation starts. void OnEditOpenG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); _variant_t v = var_Items->GetCellValue(var_Items->GetFocusItem(),long(0)); _bstr_t c = var_Items->GetCellCaption(var_Items->GetFocusItem(),long(0)); EXG2ANTTLib::IEditorPtr var_Editor = spG2antt1->GetColumns()->GetItem(long(1))->GetEditor(); var_Editor->ClearItems(); var_Editor->AddItem(v,L"c",vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"DropDownList"))); EXG2ANTTLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXG2ANTTLib::DropDownListType); var_Editor->AddItem(1,L"First",vtMissing); var_Editor->AddItem(2,L"Second",vtMissing); var_Editor->AddItem(3,L"Third",vtMissing); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"DropDownList-Related")))->GetEditor()->PutEditType(EXG2ANTTLib::DropDownListType); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(long(1)),long(1),long(-1)); var_Items->PutCellValue(var_Items->AddItem(long(2)),long(1),long(-1)); var_Items->PutCellValue(var_Items->AddItem(long(3)),long(1),long(-1)); var_Items->PutLockedItemCount(EXG2ANTTLib::exBottom,1); long h = var_Items->GetLockedItem(EXG2ANTTLib::exBottom,0); var_Items->PutItemDivider(h,0); var_Items->PutItemDividerLineAlignment(h,EXG2ANTTLib::DividerTop); var_Items->PutCellEditorVisible(h,long(0),EXG2ANTTLib::exEditorHidden); var_Items->PutCellSingleLine(h,long(0),EXG2ANTTLib::exCaptionWordWrap); var_Items->PutCellValueFormat(h,long(0),EXG2ANTTLib::exHTML); var_Items->PutCellValue(h,long(0),_bstr_t("The drop down editor in the second column is filled during the <b>EditOpen event</b>, and the values are based on the selection") + " on the first column."); spG2antt1->EndUpdate(); |
1398 |
Is it possible background color displayed when the mouse passes over an item
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Def"); spG2antt1->PutHotBackColor(RGB(0,0,128)); spG2antt1->PutHotForeColor(RGB(255,255,255)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem("Item A"); var_Items->AddItem("Item B"); var_Items->AddItem("Item C"); spG2antt1->EndUpdate(); |
1397 |
Is it possible to magnify a specified date and apply a different background color
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutDrawLevelSeparator(EXG2ANTTLib::exLevelNoLine); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->PutFirstVisibleDate(COleDateTime(2011,11,23,0,00,00).operator DATE()); var_Chart->PutLevelCount(3); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); var_Chart->PutAllowInsideZoom(VARIANT_TRUE); var_Chart->GetInsideZooms()->Add(COleDateTime(2011,11,29,0,00,00).operator DATE())->PutAllowCustomFormat(VARIANT_TRUE); EXG2ANTTLib::IInsideZoomPtr var_InsideZoom = var_Chart->GetInsideZooms()->GetItem(COleDateTime(2011,11,29,0,00,00).operator DATE()); var_InsideZoom->PutWidth(68); var_InsideZoom->GetCustomFormat()->PutBackColorChart(RGB(224,224,224)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hA = var_Items->AddItem("Task A"); var_Items->AddBar(hA,"Task",COleDateTime(2011,11,24,0,00,00).operator DATE(),COleDateTime(2011,11,26,0,00,00).operator DATE(),"A",vtMissing); long hB = var_Items->AddItem("Task B"); var_Items->AddBar(hB,"Task",COleDateTime(2011,11,28,0,00,00).operator DATE(),COleDateTime(2011,12,1,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddLink("LinkAB",hA,"A",hB,"B"); var_Items->PutLink("LinkAB",EXG2ANTTLib::exLinkStyle,long(2)); var_Items->PutLink("LinkAB",EXG2ANTTLib::exLinkWidth,long(2)); spG2antt1->EndUpdate(); |
1396 |
Could you please tell me how to add multiple bars to the one line
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(2002,1,1,0,00,00).operator DATE()); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2002,1,2,0,00,00).operator DATE(),COleDateTime(2002,1,4,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2002,1,6,0,00,00).operator DATE(),COleDateTime(2002,1,10,0,00,00).operator DATE(),"B",vtMissing); var_Items->PutItemBar(h,"A",EXG2ANTTLib::exBarColor,long(255)); var_Items->AddLink("AB",h,"A",h,"B"); spG2antt1->EndUpdate(); |
1395 |
My development environment does not have any Object,GetOcx,DefaultDispatch,GetControlUnknown,nativeObject, ... property, is there any alternative I can pass the component to PrintExt so I can get printed
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->PutLink("L1",EXG2ANTTLib::exLinkStartPos,long(0)); spG2antt1->EndUpdate(); spG2antt1->PutTemplate(L"Dim p;p = CreateObject(`Exontrol.Print`);p.PrintExt = Me;p.AutoRelease = False;p.Preview();"); |
1394 |
My development environment does not have any Object,GetOcx,DefaultDispatch,GetControlUnknown,nativeObject, ... property, is there any alternative I can pass the component to PrintExt so I can get printed
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->PutLink("L1",EXG2ANTTLib::exLinkStartPos,long(0)); spG2antt1->EndUpdate(); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'EXPRINTLib' for the library: 'ExPrint 1.0 Control Library' #import <ExPrint.dll> using namespace EXPRINTLib; */ EXPRINTLib::IExPrintPtr var_Print = ::CreateObject(L"Exontrol.Print"); var_Print->PutPrintExt(((EXG2ANTTLib::IG2anttPtr)(spG2antt1->ExecuteTemplate(L"me")))); var_Print->Preview(); |
1393 |
Is it possible to display the bar's captions or labels with a different font/size
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutDefaultItemHeight(24); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Default"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"","This is a the control's font"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); h = var_Items->AddItem("Smaller"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"","<font ;5>This is a the control's font with a smaller size"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); h = var_Items->AddItem("Larger"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"","<font ;15>This is a the control's font with a larger size"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); h = var_Items->AddItem("Tahoma 1"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"","<font Tahoma>This is using a Tahoma font"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); h = var_Items->AddItem("Tahoma 2"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"","<font Tahoma;14>This is using a <b>Tahoma</b> font with a different size"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); spG2antt1->EndUpdate(); |
1392 |
How can I apply the same ConditionalFormat on more than 1(one) column (multiple columns and not on item)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat = spG2antt1->GetConditionalFormats()->Add(L"1","K1"); var_ConditionalFormat->PutBackColor(RGB(255,0,0)); var_ConditionalFormat->PutApplyTo(EXG2ANTTLib::FormatApplyToEnum(0x1)); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat1 = spG2antt1->GetConditionalFormats()->Add(L"1","K2"); var_ConditionalFormat1->PutBackColor(RGB(255,0,0)); var_ConditionalFormat1->PutApplyTo(EXG2ANTTLib::FormatApplyToEnum(0x2)); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Column 1"); var_Columns->Add(L"Column 2"); var_Columns->Add(L"Column 3"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(vtMissing); var_Items->AddItem(vtMissing); var_Items->AddItem(vtMissing); spG2antt1->EndUpdate(); |
1391 |
Is it possible to change the height for all items at once
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->GetColumns()->Add(L"Items"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(0,VARIANT_TRUE); spG2antt1->EndUpdate(); spG2antt1->PutDefaultItemHeight(12); spG2antt1->GetItems()->PutItemHeight(0,12); |
1390 |
Is it possible to include the weekday when displaying the date
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column->PutFormatColumn(L"value + '<font ;6> ' + (weekday(date(value)) case(0:'Sun';1:'Mon';2:'Tue';3:'Wed';4:'Thu';5:'Fri';6:'Sat'))"); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column1->PutFormatColumn(L"value + '<font ;6> ' + (weekday(date(value)) case(0:'Sun';1:'Mon';2:'Tue';3:'Wed';4:'Thu';5:'Fri';6:'Sat'))"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,256); var_Chart->PutNonworkingDays(0); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,24,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,25,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 3"),"Task",COleDateTime(2006,9,23,0,00,00).operator DATE(),COleDateTime(2006,9,26,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1389 |
I need my chart to display the end date with on day less. How can I do this (Method 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Tasks"); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Start")))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"End"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column->PutFormatColumn(L"shortdate(date(value)-1)"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,196); var_Chart->PutNonworkingDays(0); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,24,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,25,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 3"),"Task",COleDateTime(2006,9,23,0,00,00).operator DATE(),COleDateTime(2006,9,26,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1388 |
Is it possible to display my custom time-units
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(long(0)); var_Chart->PutNonworkingDays(0); EXG2ANTTLib::ILevelPtr var_Level = var_Chart->GetLevel(0); var_Level->PutUnit(EXG2ANTTLib::exDay); var_Level->PutCount(16); var_Level->PutAlignment(EXG2ANTTLib::CenterAlignment); var_Level->PutLabel("<%i%>"); var_Level->PutFormatLabel(L"'Half ' + (1 + (value/16) mod 2)"); EXG2ANTTLib::ILevelPtr var_Level1 = var_Chart->GetLevel(1); var_Level1->PutLabel("<%i%>"); var_Level1->PutFormatLabel(L"1 + value mod 16"); var_Level1->PutReplaceLabel(L"2",L"<font ;10><B>Y"); var_Chart->PutAdjustLevelsToBase(VARIANT_TRUE); var_Chart->PutScrollRange(EXG2ANTTLib::exStartDate,long(0)); var_Chart->PutScrollRange(EXG2ANTTLib::exEndDate,long(31)); |
1387 |
Is it possible to add new records and see them in the control's view using the DataSource
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutSelectItem(Item,VARIANT_TRUE); var_Items->EnsureVisibleItem(Item); spG2antt1->Edit(long(0)); } // ButtonClick event - Occurs when user clicks on the cell's button. void OnButtonClickG2antt1(long Item,long ColIndex,VARIANT Key) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ((ADODB::_RecordsetPtr)(spG2antt1->GetDataSource()))->AddNew(vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADODB.Recordset"); rs->Append(L"Task",ADODB::adBSTR,0,vtMissing,vtMissing); rs->Append(L"Start",ADODB::adDate,0,vtMissing,vtMissing); rs->Append(L"End",ADODB::adDate,0,vtMissing,vtMissing); rs->Open(vtMissing,vtMissing,vtMissing,vtMissing,0); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); spG2antt1->PutDetectAddNew(VARIANT_TRUE); spG2antt1->PutDetectDelete(VARIANT_TRUE); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutLockedItemCount(EXG2ANTTLib::exTop,1); long h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,0); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,22); var_Items->PutCellValue(h,long(0),"AddNew"); var_Items->PutCellHasButton(h,long(0),VARIANT_TRUE); var_Items->PutCellHAlignment(h,long(0),EXG2ANTTLib::CenterAlignment); |
1386 |
How can I limit the bars to scrolling range only
// CreateBar event - Fired when the user creates a new bar. void OnCreateBarG2antt1(long Item,DATE DateStart,DATE DateEnd) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutItemBar(Item,"newbar",EXG2ANTTLib::exBarMinStart,spG2antt1->GetChart()->GetScrollRange(EXG2ANTTLib::exMinDate)); var_Items->PutItemBar(Item,"newbar",EXG2ANTTLib::exBarMaxEnd,spG2antt1->GetChart()->GetScrollRange(EXG2ANTTLib::exMaxDate)); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,56); var_Chart->PutScrollRange(EXG2ANTTLib::exStartDate,COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutScrollRange(EXG2ANTTLib::exEndDate,COleDateTime(2001,1,15,0,00,00).operator DATE()); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,12,0,00,00).operator DATE()); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exCreateBarAuto); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem("Task 1"); var_Items->AddItem("Task 2"); var_Items->AddItem("Task 3"); spG2antt1->EndUpdate(); |
1385 |
How do I get the handle of the last added item
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetColumns()->Add(L"Def"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(long(1)); var_Items->AddItem(long(2)); OutputDebugStringW( _bstr_t(var_Items->GetItemByIndex(var_Items->GetItemCount())) ); |
1384 |
How can I set the charts date format to any other international Format then the US version. I would need "dd.mmm.yyyy" instead of "mmm.d.'yy"
|
1383 |
Is it possible to define the bar colors, and have the cumulative histogram showing the same colors
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutSingleSel(VARIANT_FALSE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutDrawGridLines(EXG2ANTTLib::exAllLines); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,24,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutHistogramView(EXG2ANTTLib::HistogramViewEnum(EXG2ANTTLib::exHistogramNoGrouping | EXG2ANTTLib::exHistogramLeafItems | EXG2ANTTLib::exHistogramUnlockedItems | EXG2ANTTLib::exHistogramSelectedItems)); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHistogramType(EXG2ANTTLib::exHistCumulative); var_Bar->PutHistogramItems(6); var_Bar->PutHistogramPattern(var_Bar->GetPattern()); var_Bar->PutHistogramCumulativeOriginalColorBars(EXG2ANTTLib::exKeepOriginalColor); var_Bar->PutOverlaidType(EXG2ANTTLib::exOverlaidBarsOffset); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Project"); var_Items->PutItemBold(h,VARIANT_TRUE); var_Items->PutSelectableItem(h,VARIANT_FALSE); long h1 = var_Items->InsertItem(h,vtMissing,"Item 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),vtMissing,vtMissing); h1 = var_Items->InsertItem(h,vtMissing,"Item 2"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),vtMissing,vtMissing); h1 = var_Items->InsertItem(h,vtMissing,"Item 3"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,3,0,00,00).operator DATE(),"green",vtMissing); var_Items->PutItemBar(h1,"green",EXG2ANTTLib::exBarColor,long(65280)); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"red",vtMissing); var_Items->PutItemBar(h1,"red",EXG2ANTTLib::exBarColor,long(255)); var_Items->PutExpandItem(h,VARIANT_TRUE); var_Items->SelectAll(); spG2antt1->EndUpdate(); |
1382 |
How can I hide the values shown in the legend when cumulative histogram is displayed
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutHistogramView(EXG2ANTTLib::HistogramViewEnum(EXG2ANTTLib::exHistogramNoGrouping | EXG2ANTTLib::exHistogramLeafItems | EXG2ANTTLib::exHistogramUnlockedItems | EXG2ANTTLib::exHistogramCheckedItems)); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHistogramPattern(EXG2ANTTLib::exPatternSolid); var_Bar->PutHistogramType(EXG2ANTTLib::exHistCumulative); var_Bar->PutHistogramItems(6); var_Bar->PutHistogramRulerLinesColor(RGB(128,0,0)); var_Bar->PutHistogramBorderColor(RGB(1,0,0)); var_Bar->PutHistogramCumulativeShowLegend(65535); var_Bar->PutHistogramCumulativeOriginalColorBars(EXG2ANTTLib::exChangeColor); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Column"))); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutPartialCheck(VARIANT_TRUE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Project 1"); var_Items->AddBar(var_Items->InsertItem(h,vtMissing,"Item 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->InsertItem(h,vtMissing,"Item 2"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->InsertItem(h,vtMissing,"Item 3"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->InsertItem(h,vtMissing,"Item 4"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutCellState(var_Items->GetItemByIndex(1),long(0),1); var_Items->PutExpandItem(h,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1381 |
Is it possible to define the bar colors, and have the cumulative histogram showing the same colors
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutSelBackColor(spG2antt1->GetBackColor()); spG2antt1->PutSelForeColor(spG2antt1->GetForeColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutHistogramView(EXG2ANTTLib::HistogramViewEnum(EXG2ANTTLib::exHistogramNoGrouping | EXG2ANTTLib::exHistogramLeafItems | EXG2ANTTLib::exHistogramUnlockedItems | EXG2ANTTLib::exHistogramCheckedItems)); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutColor(RGB(128,128,128)); var_Bar->PutHistogramType(EXG2ANTTLib::exHistCumulative); var_Bar->PutHistogramItems(6); var_Bar->PutHistogramRulerLinesColor(RGB(128,0,0)); var_Bar->PutHistogramBorderColor(RGB(1,0,0)); var_Bar->PutHistogramCumulativeColors(2); var_Bar->PutHistogramCumulativeColor(0,RGB(0,0,255)); var_Bar->PutHistogramCumulativeColor(1,RGB(0,0,255)); var_Bar->PutHistogramCumulativeOriginalColorBars(EXG2ANTTLib::exChangeColor); var_Bar->PutHistogramPattern(var_Bar->GetPattern()); var_Bar->PutHistogramCumulativeShowLegend(65535); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Column"))); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutPartialCheck(VARIANT_TRUE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Project 1"); var_Items->AddBar(var_Items->InsertItem(h,vtMissing,"Item 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->InsertItem(h,vtMissing,"Item 2"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->InsertItem(h,vtMissing,"Item 3"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->InsertItem(h,vtMissing,"Item 4"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutCellState(var_Items->GetItemByIndex(1),long(0),1); var_Items->PutExpandItem(h,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1380 |
Is it possible to show the non-working pattern over the bars
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutNonworkingDaysPattern(EXG2ANTTLib::exPatternBDiagonal); var_Chart->PutNonworkingDaysColor(RGB(0,0,0)); var_Chart->PutPaneWidth(VARIANT_FALSE,40); var_Chart->PutFirstVisibleDate(COleDateTime(2005,6,20,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutHistogramView(EXG2ANTTLib::HistogramViewEnum(EXG2ANTTLib::exHistogramBackground | EXG2ANTTLib::exHistogramAllItems)); var_Chart->PutLevelCount(2); EXG2ANTTLib::IBarsPtr var_Bars = var_Chart->GetBars(); EXG2ANTTLib::IBarPtr var_Bar = var_Bars->Add(L"Empty"); var_Bar->PutColor(RGB(0,0,0)); var_Bar->PutPattern(EXG2ANTTLib::exPatternFDiagonal); var_Bar->PutShape(EXG2ANTTLib::exShapeSolidFrameless); EXG2ANTTLib::IBarPtr var_Bar1 = var_Bars->Add(L"Task:Empty"); var_Bar1->PutShortcut(L"Task"); var_Bar1->PutHistogramItems(-5); var_Bar1->PutHistogramCriticalValue(3); var_Bar1->PutHistogramType(EXG2ANTTLib::exHistOverload); var_Bar1->PutHistogramPattern(var_Bar1->GetPattern()); var_Bar1->PutDef(EXG2ANTTLib::exBarCaption,"<%=%258%> working days bar"); var_Bar1->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar1->PutDef(EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); var_Chart->PutUnitWidthNonworking(-12); var_Chart->GetLevel(1)->PutFormatLabel(L"weekday(dvalue) in (0,6) ? `` : value"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A"),"Task",COleDateTime(2005,6,23,0,00,00).operator DATE(),COleDateTime(2005,6,29,0,00,00).operator DATE(),"",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B"),"Task",COleDateTime(2005,6,24,0,00,00).operator DATE(),COleDateTime(2005,6,28,0,00,00).operator DATE(),"",vtMissing); spG2antt1->EndUpdate(); |
1379 |
I'm showing values from a ado recordset from sql 2005. When I try to edit a column with integers, it just skips back to the original numbers after pressing enter..., why
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // Error event - Fired when an internal error occurs. void OnErrorG2antt1(long Error,LPCTSTR Description) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Error" ); OutputDebugStringW( L"Description" ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(1994,8,3,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAllVisible); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenKeyset,ADODB::adLockReadOnly,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); spG2antt1->EndUpdate(); |
1378 |
Is it possible to reduce the non-working parts of the control
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,40); var_Chart->PutFirstVisibleDate(COleDateTime(2005,6,20,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutHistogramView(EXG2ANTTLib::exHistogramAllItems); var_Chart->PutLevelCount(2); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHistogramType(EXG2ANTTLib::exHistOverAllocation); var_Bar->PutHistogramPattern(var_Bar->GetPattern()); var_Chart->PutUnitWidthNonworking(-8); var_Chart->GetLevel(1)->PutFormatLabel(L"weekday(dvalue) in (0,6) ? `` : value"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task A"); var_Items->AddBar(h,"Task",COleDateTime(2005,6,23,0,00,00).operator DATE(),COleDateTime(2005,6,29,0,00,00).operator DATE(),"","4 working days bar"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarCanResize,VARIANT_FALSE); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarEffort,long(4)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); h = var_Items->AddItem("Task B"); var_Items->AddBar(h,"Task",COleDateTime(2005,6,28,0,00,00).operator DATE(),COleDateTime(2005,6,30,0,00,00).operator DATE(),"","2 working days bar"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarCanResize,VARIANT_FALSE); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarEffort,long(2)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1377 |
I don't want to see the "schedule"/show "workload" in non-working days part of the histogram
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,40); var_Chart->PutFirstVisibleDate(COleDateTime(2005,6,20,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutHistogramView(EXG2ANTTLib::exHistogramAllItems); var_Chart->PutLevelCount(2); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHistogramType(EXG2ANTTLib::exHistOverAllocation); var_Bar->PutHistogramPattern(var_Bar->GetPattern()); var_Chart->PutShowNonworkingDates(VARIANT_FALSE); var_Chart->PutShowNonworkingUnits(VARIANT_FALSE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task A"); var_Items->AddBar(h,"Task",COleDateTime(2005,6,23,0,00,00).operator DATE(),COleDateTime(2005,6,29,0,00,00).operator DATE(),"","4 working days bar"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarCanResize,VARIANT_FALSE); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarEffort,long(4)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); h = var_Items->AddItem("Task B"); var_Items->AddBar(h,"Task",COleDateTime(2005,6,28,0,00,00).operator DATE(),COleDateTime(2005,6,30,0,00,00).operator DATE(),"","2 working days bar"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarCanResize,VARIANT_FALSE); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarEffort,long(2)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1376 |
The control shows, and handles non-working days PERFECT, but how is it possible to reflect this in the Histogram. I don't want to "schedule"/show "workload" in non-working days...
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,40); var_Chart->PutFirstVisibleDate(COleDateTime(2005,6,20,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(64); var_Chart->PutHistogramView(EXG2ANTTLib::exHistogramAllItems); var_Chart->PutLevelCount(2); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHistogramType(EXG2ANTTLib::exHistOverAllocation); var_Bar->PutHistogramPattern(var_Bar->GetPattern()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task A"); var_Items->AddBar(h,"Task",COleDateTime(2005,6,23,0,00,00).operator DATE(),COleDateTime(2005,6,29,0,00,00).operator DATE(),"","4 working days bar"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarCanResize,VARIANT_FALSE); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarEffort,long(4)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); h = var_Items->AddItem("Task B"); var_Items->AddBar(h,"Task",COleDateTime(2005,6,28,0,00,00).operator DATE(),COleDateTime(2005,6,30,0,00,00).operator DATE(),"","2 working days bar"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarCanResize,VARIANT_FALSE); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarEffort,long(2)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1375 |
When I do select the button in the overview-zoom I want the scaling to change accordingly. Can I set different scales per selected zoom level
|
1374 |
How do I display Icons instead of text in the overview zoom area
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") + "lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" + "0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" + "NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAllVisible); var_Chart->PutAllowOverviewZoom(EXG2ANTTLib::exAlwaysZoom); var_Chart->PutLabel(EXG2ANTTLib::exSecond,L""); var_Chart->PutLabel(EXG2ANTTLib::exYear,L""); OutputDebugStringW( var_Chart->GetOverviewZoomCaption() ); var_Chart->PutOverviewZoomCaption(L"Year|½Year|¼Year|Month|Third|<img>1</img>|Day|Hour|Min|Sec"); |
1373 |
How do I get it to only display Min, Hour, Day, Week , Month, ie remove Sec and Year in the overview area
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAllVisible); var_Chart->PutAllowOverviewZoom(EXG2ANTTLib::exAlwaysZoom); var_Chart->PutLabel(EXG2ANTTLib::exSecond,L""); var_Chart->PutLabel(EXG2ANTTLib::exYear,L""); |
1372 |
Is it possible to show quarter hours markers
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutGridLineColor(RGB(0,0,0)); spG2antt1->GetVisualAppearance()->Add(3,_bstr_t("gBFLBCJwBAEHhEJAEGg4BdMIQAAYAQGKIYBkAKBQAGaAoDDUNw5QwAAwjSKkEwsACEIrjKCRShyCYZRhGcTAFBMIhkGoSZKlCIRVDCKYJDbKACSFKkNQ7AabZBgOQJV") + "gOKovThKcIybQAASJCKRY7nUIIJA+SoDSRAbqhYIgASnKqLJAkACIJJAaRjHQdJxGKKMQANBghCZseKhWgkKIJUxAdLTWAAMQuaCoZ5icRAca2fJ+XzfeBYDgmAYNQbD" + "cJhHCMMwXDaJZBiGJ4dimI4rR7JIDzDJ8cxbEKTZ5meg5boGRZNTrMQA0fQ9MynK6vahfOi7DpuaZnWrcMb2fYNZwrGq0bxoW58BwmP5/XrkNa4XgcVgmAUBA"); spG2antt1->PutHeaderHeight(20); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exHour); EXG2ANTTLib::ILevelPtr var_Level = var_Chart->GetLevel(0); var_Level->PutAlignment(EXG2ANTTLib::exHOutside); var_Level->PutLabel("<%dddd%>, <%mmmm%> <b><%d%></b>, <%yyyy%>"); var_Level->PutDrawTickLines(EXG2ANTTLib::exLevelSolidLine); EXG2ANTTLib::ILevelPtr var_Level1 = var_Chart->GetLevel(1); var_Level1->PutLabel("<%hh%>:00"); var_Level1->PutBackColor(0x3000000); var_Level1->PutDrawTickLines(EXG2ANTTLib::exLevelSolidLine); var_Chart->PutDrawLevelSeparator(EXG2ANTTLib::exLevelSolidLine); var_Chart->PutUnitWidth(64); var_Chart->PutResizeUnitScale(EXG2ANTTLib::exMinute); var_Chart->PutResizeUnitCount(15); spG2antt1->EndUpdate(); |
1371 |
How can I ensure or always show the labels on the chart part, when scrolling the chart to left or right
|
1370 |
I associate the Start and End columns with bars, but some of them are not shown. What am I doing wrong
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,25,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarKey,"K1"); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarKey,"K1"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem(vtMissing),"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem(vtMissing),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem(vtMissing),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"????","????"); spG2antt1->EndUpdate(); |
1369 |
How can I implement OLE Drag and Drop operation
// OLEStartDrag event - Occurs when the OLEDrag method is called. void OnOLEStartDragG2antt1(LPDISPATCH Data,long FAR* AllowedEffects) { // Data.SetData("your data to drag") /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); AllowedEffects = 2; } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->GetColumns()->Add(L"Default"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem("Item 1"); var_Items->AddItem("Item 2"); var_Items->AddItem("Item 3"); var_Items->AddItem("Item 4"); var_Items->AddItem("Item 5"); spG2antt1->PutOLEDropMode(EXG2ANTTLib::exOLEDropManual); spG2antt1->EndUpdate(); |
1368 |
I can not associate the bar's start and end properties with my start/end columns, only if the bar's key is empty or null. What can I do
// ButtonClick event - Occurs when user clicks on the cell's button. void OnButtonClickG2antt1(long Item,long ColIndex,VARIANT Key) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->GetItem("Tasks")->PutDef(EXG2ANTTLib::exCellValueToItemBarKey,"B"); var_Columns->GetItem("Start")->PutDef(EXG2ANTTLib::exCellValueToItemBarKey,"B"); var_Columns->GetItem("End")->PutDef(EXG2ANTTLib::exCellValueToItemBarKey,"B"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(Item,long(1),"B"); var_Items->PutItemBar(0,"B",EXG2ANTTLib::exBarColor,long(0)); var_Items->PutItemBar(0,"A",EXG2ANTTLib::exBarColor,long(16775408)); spG2antt1->EndUpdate(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Tasks"))); var_Column->PutWidth(32); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(3)); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarKey,"A"); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Start"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarKey,"A"); var_Column1->GetEditor()->PutEditType(EXG2ANTTLib::DateType); EXG2ANTTLib::IColumnPtr var_Column2 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"End"))); var_Column2->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column2->PutDef(EXG2ANTTLib::exCellValueToItemBarKey,"A"); var_Column2->GetEditor()->PutEditType(EXG2ANTTLib::DateType); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_TRUE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,196); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutPattern(EXG2ANTTLib::exPatternBDiagonal); var_Bar->PutOverlaidType(EXG2ANTTLib::OverlaidBarsTypeEnum(EXG2ANTTLib::exOverlaidBarsStackAutoArrange | EXG2ANTTLib::exOverlaidBarsStack)); var_Bar->PutOverlaid(EXG2ANTTLib::exOverlaidBarsTransparent,long(80)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutLockedItemCount(EXG2ANTTLib::exTop,1); long h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,0); var_Items->PutCellValue(h,long(0),"Select"); var_Items->PutCellHasButton(h,long(0),VARIANT_TRUE); var_Items->PutCellMerge(h,long(1),long(2)); var_Items->PutCellValue(h,long(1),"A"); var_Items->GetCellEditor(h,long(1))->PutEditType(EXG2ANTTLib::EditType); EXG2ANTTLib::IItemsPtr var_Items1 = spG2antt1->GetItems(); var_Items1->PutAllowCellValueToItemBar(VARIANT_TRUE); h = var_Items1->AddItem("Task 1"); var_Items1->AddBar(h,"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,24,0,00,00).operator DATE(),"A","A"); var_Items1->AddBar(h,"Task",COleDateTime(2006,9,25,0,00,00).operator DATE(),COleDateTime(2006,9,28,0,00,00).operator DATE(),"B","B"); var_Items1->PutItemBar(h,"B",EXG2ANTTLib::exBarColor,long(16775408)); h = var_Items1->AddItem("Task 2"); var_Items1->AddBar(h,"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,25,0,00,00).operator DATE(),"A","A"); var_Items1->AddBar(h,"Task",COleDateTime(2006,9,26,0,00,00).operator DATE(),COleDateTime(2006,9,29,0,00,00).operator DATE(),"B","B"); var_Items1->PutItemBar(h,"B",EXG2ANTTLib::exBarColor,long(16775408)); spG2antt1->EndUpdate(); |
1367 |
How can I determine the order of the events
// AddLink event - Occurs when the user links two bars using the mouse. void OnAddLinkG2antt1(LPCTSTR LinkKey) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"AddLink" ); OutputDebugStringW( L"LinkKey" ); } // AfterExpandItem event - Fired after an item is expanded (collapsed). void OnAfterExpandItemG2antt1(long Item) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"AfterExpandItem" ); OutputDebugStringW( L"Item" ); } // AllowLink event - Notifies at runtime when a link between two bars is possible. void OnAllowLinkG2antt1(long StartItem,VARIANT StartBarKey,long EndItem,VARIANT EndBarKey,VARIANT FAR* LinkKey,BOOL FAR* Cancel) { OutputDebugStringW( L"AllowLink" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"StartItem" ); OutputDebugStringW( L"StartBarKey" ); OutputDebugStringW( L"EndItem" ); OutputDebugStringW( L"EndBarKey" ); OutputDebugStringW( L"LinkKey" ); } // AnchorClick event - Occurs when an anchor element is clicked. void OnAnchorClickG2antt1(LPCTSTR AnchorID,LPCTSTR Options) { OutputDebugStringW( L"AnchorClick" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"AnchorID" ); OutputDebugStringW( L"Options" ); } // BarParentChange event - Occurs just before moving a bar from current item to another item. void OnBarParentChangeG2antt1(long Item,VARIANT Key,long NewItem,BOOL FAR* Cancel) { OutputDebugStringW( L"BarParentChange" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); OutputDebugStringW( L"Key" ); OutputDebugStringW( L"NewItem" ); } // BarResize event - Occurs when a bar is moved or resized. void OnBarResizeG2antt1(long Item,VARIANT Key) { OutputDebugStringW( L"BarResize" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); OutputDebugStringW( L"Key" ); } // BarResizing event - Occurs when a bar is moving or resizing. void OnBarResizingG2antt1(long Item,VARIANT Key) { OutputDebugStringW( L"BarResizing" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); OutputDebugStringW( L"Key" ); } // BeforeExpandItem event - Fired before an item is about to be expanded (collapsed). void OnBeforeExpandItemG2antt1(long Item,VARIANT FAR* Cancel) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"BeforeExpandItem" ); OutputDebugStringW( L"Item" ); } // ButtonClick event - Occurs when user clicks on the cell's button. void OnButtonClickG2antt1(long Item,long ColIndex,VARIANT Key) { OutputDebugStringW( L"ButtonClick" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); OutputDebugStringW( L"ColIndex" ); OutputDebugStringW( L"Key" ); } // CellImageClick event - Fired after the user clicks on the image's cell area. void OnCellImageClickG2antt1(long Item,long ColIndex) { OutputDebugStringW( L"CellImageClick" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); OutputDebugStringW( L"ColIndex" ); } // CellStateChanged event - Fired after cell's state has been changed. void OnCellStateChangedG2antt1(long Item,long ColIndex) { OutputDebugStringW( L"CellStateChanged" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); OutputDebugStringW( L"ColIndex" ); } // Change event - Occurs when the user changes the cell's content. void OnChangeG2antt1(long Item,long ColIndex,VARIANT FAR* NewValue) { OutputDebugStringW( L"Change" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); OutputDebugStringW( L"ColIndex" ); OutputDebugStringW( L"NewValue" ); } // ChartEndChanging event - Occurs after the chart has been changed. void OnChartEndChangingG2antt1(long Operation) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"ChartEndChanging" ); OutputDebugStringW( L"Operation" ); } // ChartSelectionChanged event - Occurs when the user selects objects in the chart area. void OnChartSelectionChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"ChartSelectionChanged" ); } // ChartStartChanging event - Occurs when the chart is about to be changed. void OnChartStartChangingG2antt1(long Operation) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"ChartStartChanging" ); OutputDebugStringW( L"Operation" ); } // Click event - Occurs when the user presses and then releases the left mouse button over the tree control. void OnClickG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Click" ); } // ColumnClick event - Fired after the user clicks on column's header. void OnColumnClickG2antt1(LPDISPATCH Column) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"ColumnClick" ); } // CreateBar event - Fired when the user creates a new bar. void OnCreateBarG2antt1(long Item,DATE DateStart,DATE DateEnd) { OutputDebugStringW( L"CreateBar" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); OutputDebugStringW( L"DateStart" ); OutputDebugStringW( L"DateEnd" ); } // DateChange event - Occurs when the first visible date is changed. void OnDateChangeG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"DateChange" ); } // DblClick event - Occurs when the user dblclk the left mouse button over an object. void OnDblClickG2antt1(short Shift,long X,long Y) { OutputDebugStringW( L"DblClick" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Shift" ); OutputDebugStringW( L"X" ); OutputDebugStringW( L"Y" ); spG2antt1->Edit(vtMissing); } // Edit event - Occurs just before editing the focused cell. void OnEditG2antt1(long Item,long ColIndex,BOOL FAR* Cancel) { OutputDebugStringW( L"Edit" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); OutputDebugStringW( L"ColIndex" ); } // EditClose event - Occurs when the edit operation ends. void OnEditCloseG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"EditClose" ); } // EditOpen event - Occurs when the edit operation starts. void OnEditOpenG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"EditOpen" ); } // FilterChange event - Occurs when the filter was changed. void OnFilterChangeG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"FilterChange" ); } // FilterChanging event - Notifies your application that the filter is about to change. void OnFilterChangingG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"FilterChanging" ); } // FocusChanged event - Occurs when a cell gets the focus. void OnFocusChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"FocusChanged" ); } // InsideZoom event - Notifies your application that a date is about to be magnified. void OnInsideZoomG2antt1(DATE DateTime) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"InsideZoom" ); OutputDebugStringW( L"DateTime" ); } // KeyDown event - Occurs when the user presses a key while an object has the focus. void OnKeyDownG2antt1(short FAR* KeyCode,short Shift) { OutputDebugStringW( L"KeyDown" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"KeyCode" ); OutputDebugStringW( L"Shift" ); } // KeyPress event - Occurs when the user presses and releases an ANSI key. void OnKeyPressG2antt1(short FAR* KeyAscii) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"KeyPress" ); OutputDebugStringW( L"KeyAscii" ); } // KeyUp event - Occurs when the user releases a key while an object has the focus. void OnKeyUpG2antt1(short FAR* KeyCode,short Shift) { OutputDebugStringW( L"KeyUp" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"KeyCode" ); OutputDebugStringW( L"Shift" ); } // LayoutChanged event - Occurs when column's position or column's size is changed. void OnLayoutChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"LayoutChanged" ); } // MouseDown event - Occurs when the user presses a mouse button. void OnMouseDownG2antt1(short Button,short Shift,long X,long Y) { OutputDebugStringW( L"MouseDown" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Button" ); OutputDebugStringW( L"Shift" ); OutputDebugStringW( L"X" ); OutputDebugStringW( L"Y" ); } // MouseMove event - Occurs when the user moves the mouse. void OnMouseMoveG2antt1(short Button,short Shift,long X,long Y) { } // MouseUp event - Occurs when the user releases a mouse button. void OnMouseUpG2antt1(short Button,short Shift,long X,long Y) { OutputDebugStringW( L"MouseUp" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Button" ); OutputDebugStringW( L"Shift" ); OutputDebugStringW( L"X" ); OutputDebugStringW( L"Y" ); } // OffsetChanged event - Occurs when the scroll position has been changed. void OnOffsetChangedG2antt1(BOOL Horizontal,long NewVal) { OutputDebugStringW( L"OffsetChanged" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Horizontal" ); OutputDebugStringW( L"NewVal" ); } // OversizeChanged event - Occurs when the right range of the scroll has been changed. void OnOversizeChangedG2antt1(BOOL Horizontal,long NewVal) { OutputDebugStringW( L"OversizeChanged" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Horizontal" ); OutputDebugStringW( L"NewVal" ); } // OverviewZoom event - Occurs once the user selects a new time scale unit in the overview zoom area. void OnOverviewZoomG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"OverviewZoom" ); } // RClick event - Fired when right mouse button is clicked void OnRClickG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"RClick" ); } // ScrollButtonClick event - Occurs when the user clicks a button in the scrollbar. void OnScrollButtonClickG2antt1(long ScrollBar,long ScrollPart) { OutputDebugStringW( L"ScrollButtonClick" ); EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"ScrollBar" ); OutputDebugStringW( L"ScrollPart" ); } // SelectionChanged event - Fired after a new item has been selected. void OnSelectionChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"SelectionChanged" ); } // Sort event - Fired when the control sorts a column. void OnSortG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Sort" ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") + "lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" + "0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" + "NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->PutGridLineStyle(EXG2ANTTLib::exGridLinesHDash); spG2antt1->PutAutoEdit(VARIANT_FALSE); spG2antt1->PutExpandOnDblClick(VARIANT_FALSE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutAllowInsideZoom(VARIANT_TRUE); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAllVisible); var_Chart->PutAllowOverviewZoom(EXG2ANTTLib::exAlwaysZoom); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutDrawGridLines(EXG2ANTTLib::exAllLines); var_Chart->PutGridLineStyle(EXG2ANTTLib::GridLinesStyleEnum(EXG2ANTTLib::exGridLinesVSolid | EXG2ANTTLib::exGridLinesHDash)); var_Chart->PutLevelCount(2); var_Chart->GetLevel(0)->PutDrawGridLines(VARIANT_TRUE); var_Chart->GetBars()->GetItem("Task")->PutPattern(EXG2ANTTLib::exPatternSolid); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutLabel(EXG2ANTTLib::exSecond,L""); var_Chart->PutLabel(EXG2ANTTLib::exMinute,L""); var_Chart->PutLabel(EXG2ANTTLib::exHour,L""); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Column"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->GetEditor()->PutEditType(EXG2ANTTLib::EditType); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Button"))); var_Column1->PutAllowSizing(VARIANT_FALSE); var_Column1->PutWidth(18); var_Column1->PutDef(EXG2ANTTLib::exCellHasButton,VARIANT_TRUE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("parent"); var_Items->PutCellImage(h,long(0),1); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"A","<a>A</a>"); var_Items->PutItemBar(h,"A",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"A",EXG2ANTTLib::exBarCanMoveToAnother,VARIANT_TRUE); var_Items->PutItemBar(h,"A",EXG2ANTTLib::exBarToolTip,"This is a bit of text that should be shown when cursor hovers the bar"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,15,0,00,00).operator DATE(),"B","<a>B</a>"); var_Items->PutItemBar(h,"B",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"B",EXG2ANTTLib::exBarCanMoveToAnother,VARIANT_TRUE); var_Items->InsertItem(h,"","child"); var_Items->PutExpandItem(h,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1366 |
How can I change the chart's horizontal grid lines
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutGridLineStyle(EXG2ANTTLib::exGridLinesHDash); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutDrawGridLines(EXG2ANTTLib::exAllLines); var_Chart->PutGridLineStyle(EXG2ANTTLib::GridLinesStyleEnum(EXG2ANTTLib::exGridLinesVSolid | EXG2ANTTLib::exGridLinesHDash)); var_Chart->PutLevelCount(2); var_Chart->GetLevel(0)->PutDrawGridLines(VARIANT_TRUE); var_Chart->GetBars()->GetItem("Task")->PutPattern(EXG2ANTTLib::exPatternSolid); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Item 1"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,15,0,00,00).operator DATE(),"B",vtMissing); spG2antt1->EndUpdate(); |
1365 |
Is there any way to determine whether the ADO operations fails
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // Error event - Fired when an internal error occurs. void OnErrorG2antt1(long Error,LPCTSTR Description) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Error" ); OutputDebugStringW( L"Description" ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(1994,8,3,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAllVisible); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenKeyset,ADODB::adLockReadOnly,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); spG2antt1->EndUpdate(); |
1364 |
Is it possible to select a column instead sorting it
// ColumnClick event - Fired after the user clicks on column's header. void OnColumnClickG2antt1(LPDISPATCH Column) { // Column.Selected = True /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->GetItem(long(0))->PutSelected(VARIANT_FALSE); spG2antt1->GetColumns()->GetItem(long(1))->PutSelected(VARIANT_FALSE); spG2antt1->GetItems()->SelectAll(); spG2antt1->EndUpdate(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); spG2antt1->PutShowFocusRect(VARIANT_FALSE); spG2antt1->PutSingleSel(VARIANT_FALSE); spG2antt1->PutFullRowSelect(EXG2ANTTLib::exRectSel); spG2antt1->PutSortOnClick(EXG2ANTTLib::exNoSort); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Column1"); var_Columns->Add(L"Column2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem("One"),long(1),"Three"); var_Items->PutCellValue(var_Items->AddItem("Two"),long(1),"Four"); var_Items->SelectAll(); spG2antt1->EndUpdate(); |
1363 |
I am using the exRectSel, and clicking the first column, has no effect, instead if I click other it works as it should
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutSearchColumnIndex(-1); spG2antt1->PutFullRowSelect(EXG2ANTTLib::exRectSel); spG2antt1->PutShowFocusRect(VARIANT_FALSE); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Column1"); var_Columns->Add(L"Column2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(long(1)),long(1),long(2)); var_Items->PutCellValue(var_Items->AddItem(long(3)),long(1),long(4)); var_Items->PutCellValue(var_Items->AddItem(long(5)),long(1),long(6)); spG2antt1->EndUpdate(); |
1362 |
Is it possible to display empty strings for 0 values
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Currency"))); var_Column->PutFormatColumn(L"dbl(value) ? currency(dbl(value)) : ``"); EXG2ANTTLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXG2ANTTLib::EditType); var_Editor->PutNumeric(EXG2ANTTLib::exFloat); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(double(1.23)); var_Items->AddItem(double(2.34)); var_Items->AddItem(long(0)); var_Items->AddItem(double(10000.99)); |
1361 |
Is it possible to display empty strings for 0 values
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetColumns()->Add(L"Number"); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Currency")))->PutComputedField(L"%0 ? currency(%0) : ``"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(double(1.23)); var_Items->AddItem(double(2.34)); var_Items->AddItem(long(0)); var_Items->AddItem(double(10000.99)); |
1360 |
How can I hide a date from the chart view, when I display hours instead days
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutHeaderHeight(32); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2011,6,8,0,00,00).operator DATE()); var_Chart->PutAdjustLevelsToBase(VARIANT_TRUE); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutLevelCount(2); var_Chart->PutAllowInsideZoom(VARIANT_TRUE); EXG2ANTTLib::ILevelPtr var_Level = var_Chart->GetLevel(0); var_Level->PutAlignment(EXG2ANTTLib::CenterAlignment); var_Level->PutLabel("<b><%d%>-<%mmm%>-<%yyyy%>"); var_Level->PutUnit(EXG2ANTTLib::exDay); EXG2ANTTLib::ILevelPtr var_Level1 = var_Chart->GetLevel(1); var_Level1->PutLabel("<%h%>"); var_Level1->PutCount(8); var_Level1->PutUnit(EXG2ANTTLib::exHour); var_Level1->PutFormatLabel(_bstr_t("date(int(dvalue)) case (#06/08/2011# : (int(value) case ( 0 : 'Shift <b>1</b><br>23/20'; 8 : 'Shift <b>2</b><br>38/30' ; 16 : '") + "Shift <b>3</b><br>24/24' ) ) ; #06/09/2011# : (int(value) case ( 0 : 'Shift <b>1</b><br>15/20'; 8 : 'Shift <b>2</b><br>30/32' ; " + "16 : 'Shift <b>3</b><br>26/24' ) ) )"); var_Chart->PutUnitWidth(64); var_Chart->PutNonworkingDays(0); var_Chart->PutAllowInsideZoom(VARIANT_TRUE); var_Chart->GetDefaultInsideZoomFormat()->PutInsideUnit(EXG2ANTTLib::exMinute); var_Chart->PutAllowResizeInsideZoom(VARIANT_FALSE); var_Chart->PutInsideZoomOnDblClick(VARIANT_FALSE); EXG2ANTTLib::IInsideZoomsPtr var_InsideZooms = var_Chart->GetInsideZooms(); var_InsideZooms->PutSplitBaseLevel(VARIANT_FALSE); var_InsideZooms->PutDefaultWidth(0); EXG2ANTTLib::IInsideZoomsPtr var_InsideZooms1 = var_Chart->GetInsideZooms(); var_InsideZooms1->Add(COleDateTime(2011,6,9,8,00,00).operator DATE()); var_InsideZooms1->Add(COleDateTime(2011,6,9,16,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1359 |
I’ve created a skin (EBN) for the bars of my chart, with rounded top corners. The problem, is that these rounded corners are applied also at beginning and the end of the non working units. Is it possible to show a different picture/skin for the non-working part of the bars
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn"); spG2antt1->GetVisualAppearance()->Add(2,"c:\\exontrol\\images\\pushed.ebn"); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->GetChart()->PutPaneWidth(VARIANT_FALSE,128); EXG2ANTTLib::IBarsPtr var_Bars = spG2antt1->GetChart()->GetBars(); var_Bars->GetItem("Task")->PutColor(0x1000000); var_Bars->GetItem("Split")->PutColor(0x2000000); var_Bars->Add(L"Task:Split")->PutShortcut(L"TS"); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task"),"TS",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,16,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1358 |
How do I display the names of the tasks on bars but not in the middle of the bar (left or right)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,27,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutPattern(EXG2ANTTLib::exPatternDot); var_Bar->PutHeight(15); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task 1"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K1","<b>to do</b> "); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarHAlignCaption,long(2)); h = var_Items->AddItem("Task 2"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2","<b>to do</b>"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarHAlignCaption,long(18)); h = var_Items->AddItem("Task 3"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K1"," <b>to do</b>"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarHAlignCaption,long(0)); h = var_Items->AddItem("Task 4"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2","<b>to do</b>"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarHAlignCaption,long(16)); spG2antt1->EndUpdate(); |
1357 |
How can I get the list of items as they are displayed
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutBackColorAlternate(RGB(240,240,240)); spG2antt1->GetColumns()->Add(L"Names"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem("Mantel"); var_Items->AddItem("Mechanik"); var_Items->AddItem("Motor"); var_Items->AddItem("Murks"); var_Items->AddItem("Märchen"); var_Items->AddItem("Möhren"); var_Items->AddItem("Mühle"); spG2antt1->GetColumns()->GetItem(long(0))->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); OutputDebugStringW( _bstr_t(spG2antt1->GetItems(long(1))) ); |
1356 |
How can I disable the left and right arrows to move to next cell while editing
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IEditorPtr var_Editor = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Edit")))->GetEditor(); var_Editor->PutEditType(EXG2ANTTLib::EditType); var_Editor->PutOption(EXG2ANTTLib::exLeftArrow,long(0)); var_Editor->PutOption(EXG2ANTTLib::exRightArrow,long(0)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem("Cell 1"); var_Items->AddItem("Cell 2"); var_Items->AddItem("Cell 3"); |
1355 |
Is it possible to define a bar that is treated as a non-working hour so user can move it at runtime
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutAllowNonworkingBars(VARIANT_TRUE); var_Chart->GetBars()->Add(L"Task:Split")->PutShortcut(L"Task"); var_Chart->PutUnitScale(EXG2ANTTLib::exHour); var_Chart->GetLevel(1)->PutLabel("<font ;4><%hh%>"); var_Chart->PutUnitWidth(12); var_Chart->PutNonworkingDaysPattern(EXG2ANTTLib::exPatternBDiagonal); var_Chart->PutNonworkingDays(0); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Machine"); var_Items->PutItemNonworkingUnits(h,VARIANT_FALSE,L"0"); var_Items->AddBar(h,"",COleDateTime(2001,1,1,9,00,00).operator DATE(),COleDateTime(2001,1,1,11,00,00).operator DATE(),"A","pause"); var_Items->PutItemBar(h,"A",EXG2ANTTLib::exBarTreatAsNonworking,VARIANT_TRUE); var_Items->AddBar(h,"Task",COleDateTime(2001,1,1,12,00,00).operator DATE(),COleDateTime(2001,1,1,17,00,00).operator DATE(),"Z",vtMissing); var_Items->PutItemBar(h,"Z",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1354 |
Is it possible to customize the chart's header so I can display shift and other values
|
1353 |
How can I change both start and end dates of the bar
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->PutFirstVisibleDate(COleDateTime(2005,6,19,0,00,00).operator DATE()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Test"); var_Items->AddBar(h,"Task",COleDateTime(2005,6,22,0,00,00).operator DATE(),COleDateTime(2005,6,27,0,00,00).operator DATE(),"t1",vtMissing); var_Items->AddBar(h,var_Items->GetItemBar(h,"t1",EXG2ANTTLib::exBarName),COleDateTime(2005,6,21,0,00,00).operator DATE(),COleDateTime(2005,6,22,0,00,00).operator DATE(),"t1",vtMissing); spG2antt1->EndUpdate(); |
1352 |
Is it possible to add new rows, as I type like in Excel
// EditClose event - Occurs when the edit operation ends. void OnEditCloseG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->AddItem(""); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAutoEdit(VARIANT_TRUE); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Default")))->GetEditor()->PutEditType(EXG2ANTTLib::EditType); spG2antt1->PutFullRowSelect(EXG2ANTTLib::exColumnSel); spG2antt1->GetItems()->AddItem(""); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutScrollBars(EXG2ANTTLib::exDisableBoth); spG2antt1->EndUpdate(); |
1351 |
How do I load bars from my table/database
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(1994,8,3,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,256); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAllVisible); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutContinueColumnScroll(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); spG2antt1->EndUpdate(); |
1350 |
Is posible to reduce the size of the picture to be shown in the bar's caption
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif"); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,78); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Default-Size"); var_Items->PutItemHeight(h,48); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1","<img>pic1</img>"); h = var_Items->AddItem("Custom-Size"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K2","<img>pic1:18</img>"); spG2antt1->EndUpdate(); |
1349 |
Is posible to reduce the size of the picture to be shown in the column's caption
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif"); spG2antt1->PutHeaderHeight(48); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"DefaultSize")))->PutHTMLCaption(L"Default-Size <img>pic1</img> Picture"); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"CustomSize")))->PutHTMLCaption(L"Custom-Size <img>pic1:16</img> Picture"); spG2antt1->EndUpdate(); |
1348 |
Is it possible to display the selected dates using a solid color instead vertical lines
|
1347 |
How can I show the cells using a different background color based on the condition I have
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutSelBackMode(EXG2ANTTLib::exTransparent); spG2antt1->PutShowFocusRect(VARIANT_FALSE); EXG2ANTTLib::IConditionalFormatsPtr var_ConditionalFormats = spG2antt1->GetConditionalFormats(); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat = var_ConditionalFormats->Add(L"dbl(%1)-dbl(%0) = 1",vtMissing); var_ConditionalFormat->PutBackColor(RGB(255,0,0)); var_ConditionalFormat->PutApplyTo(EXG2ANTTLib::FormatApplyToEnum(0x1)); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat1 = var_ConditionalFormats->Add(L"dbl(%0)-dbl(%1) = 3",vtMissing); var_ConditionalFormat1->PutBackColor(RGB(255,255,0)); var_ConditionalFormat1->PutApplyTo(EXG2ANTTLib::exFormatToColumns); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat2 = var_ConditionalFormats->Add(L"dbl(%1)-dbl(%0) = 4",vtMissing); var_ConditionalFormat2->PutForeColor(RGB(128,128,128)); var_ConditionalFormat2->PutBold(VARIANT_TRUE); var_ConditionalFormat2->PutApplyTo(EXG2ANTTLib::exFormatToItems); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C1")))->PutWidth(8); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C2")))->PutWidth(8); var_Columns->Add(L""); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(long(2)),long(1),long(3)); var_Items->PutCellValue(var_Items->AddItem(long(5)),long(1),long(2)); var_Items->PutCellValue(var_Items->AddItem(long(5)),long(1),long(6)); var_Items->PutCellValue(var_Items->AddItem(long(2)),long(1),long(6)); spG2antt1->EndUpdate(); |
1346 |
How can I specify the frame's color for all Task bars
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->GetBars()->GetItem("Task")->PutDef(EXG2ANTTLib::exBarFrameColor,long(255)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddBar(var_Items->AddItem("Task 3"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K3",vtMissing); spG2antt1->EndUpdate(); |
1345 |
Is it possible to change the bar's frame color
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(25); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutDrawGridLines(EXG2ANTTLib::exHLines); var_Chart->PutNonworkingDays(0); var_Chart->GetBars()->GetItem("Task")->PutHeight(15); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Default"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); h = var_Items->AddItem("Red-Frame"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarFrameColor,long(255)); h = var_Items->AddItem("Green-ThickFrame"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarPattern,long(4099)); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarFrameColor,long(32768)); h = var_Items->AddItem("Red-ThickFrame/Shadow"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarPattern,long(12291)); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarFrameColor,long(255)); spG2antt1->EndUpdate(); |
1344 |
I need to customize the labels on the chart. Is it possible
|
1343 |
Is it possible to show a frame around the bar
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(25); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAEGg4BOUMQAAYAQGKIYBkAKBQAGaAoDDYMgzQwAAxDELMEwsACEIrjKCVIgkHYJRjGEZxMAsEwjAoaQChEZRUhEMgxDDIIyAJIcaw0GSEZwgOQZB") + "iOEYnDANkIYJDSIYHTZIUzTJAdGSVJKNKAoKCaEgORo5SpNUghBDYKQTJyeagkaaRVCWLplRCNIwWNJdVwjEaQaaiarKNqKNpSViAEqSdKEZRLOyRZyiKQMEreY4EUDQ" + "cxUPYMNYaAC6AAparpbwCFpSYpRND3TaEE4jSLKAA0HD6QqebIDDJaFq6PbVXSTOLPNhgPQcWxeVJBXjLExUALGSYLC6nKayHZcHACKK5VbVW6ZZDdNy/BLQeD4QANG4" + "riuNJriMV4dgWVgHh+ZpgCeEIQEQJIgGkMYdA6JwjC0VAAmaJgQgmPp4lCWgSCiaB+DKIYIjqQpllMf6JgYAoAmASAWAaAZggQDJ/gKYJIDYDoDmECBGAOBBhEgVgUgS" + "YRoGYGYGCGKB2BCBwhmiBgLggIgoHoJIJGGKIeCiBYiiiLgXgCIpohoMIMGKGJODSCwghiZg6g6Y5InYPh/lAECAg"); var_Appearance->Add(2,"CP:1 2 2 -2 -2"); var_Appearance->Add(3,"CP:1 -5 -5 5 5"); var_Appearance->Add(4,"XP:Window 19 1"); var_Appearance->Add(5,"XP:TreeView 2 1"); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutDrawGridLines(EXG2ANTTLib::exHLines); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Default"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); h = var_Items->AddItem("Red-Frame"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarFrameColor,long(255)); h = var_Items->AddItem("Green-ThickFrame"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarPattern,long(4099)); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarFrameColor,long(32768)); h = var_Items->AddItem("Red-ThickFrame/Shadow"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarPattern,long(12291)); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarFrameColor,long(255)); h = var_Items->AddItem("EBN-Frame-Border"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"K2",vtMissing); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarFrameColor,long(16777216)); h = var_Items->AddItem("EBN-Inside Frame"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,9,0,00,00).operator DATE(),COleDateTime(2001,1,13,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarFrameColor,long(33554432)); h = var_Items->AddItem("EBN-Outside Frame"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,15,0,00,00).operator DATE(),COleDateTime(2001,1,18,0,00,00).operator DATE(),"K4",vtMissing); var_Items->PutItemBar(h,"K4",EXG2ANTTLib::exBarFrameColor,long(50331648)); h = var_Items->AddItem("EBN-XP Close Button"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,15,0,00,00).operator DATE(),COleDateTime(2001,1,18,0,00,00).operator DATE(),"K5",vtMissing); var_Items->PutItemBar(h,"K5",EXG2ANTTLib::exBarFrameColor,long(67108864)); h = var_Items->AddItem("EBN-XP TreeView Glyph"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,15,0,00,00).operator DATE(),COleDateTime(2001,1,18,0,00,00).operator DATE(),"K6",vtMissing); var_Items->PutItemBar(h,"K6",EXG2ANTTLib::exBarFrameColor,long(83886080)); spG2antt1->EndUpdate(); |
1342 |
Currently your control, provides customization up to Year,Month,Day,Hours,etc. I would like to add Shifts in a day. Shortly, I need to customize the chart's header. Is it possible
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2011,7,1,0,00,00).operator DATE()); var_Chart->PutAdjustLevelsToBase(VARIANT_TRUE); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutLevelCount(2); EXG2ANTTLib::ILevelPtr var_Level = var_Chart->GetLevel(0); var_Level->PutAlignment(EXG2ANTTLib::CenterAlignment); var_Level->PutLabel("<b><%d%> - <%mmmm%> - <%yyyy%>"); var_Level->PutUnit(EXG2ANTTLib::exDay); EXG2ANTTLib::ILevelPtr var_Level1 = var_Chart->GetLevel(1); var_Level1->PutLabel("<%h%>"); var_Level1->PutCount(8); var_Level1->PutUnit(EXG2ANTTLib::exHour); var_Level1->PutReplaceLabel(L"0",L" Shift 1"); var_Level1->PutReplaceLabel(L"8",L" Shift 2"); var_Level1->PutReplaceLabel(L"16",L" Shift 3"); var_Chart->PutUnitWidth(48); var_Chart->PutNonworkingDays(0); spG2antt1->EndUpdate(); |
1341 |
The exbartootip shows dates after you moved or resized the bar. My question is during the move or resizing of bar(you click on bar and drag it,during that time) , can we display the new dates simultaneously so we will know where we want to move or resize the bar to
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutDrawDateTicker(VARIANT_TRUE); var_Chart->PutDateTickerLabel(L"<%mmm%> <%d%><br><b><%yyyy%>"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Tasks A"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"K2",vtMissing); var_Items->PutSelectableItem(var_Items->AddItem(vtMissing),VARIANT_FALSE); h = var_Items->AddItem("Tasks B"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,11,0,00,00).operator DATE(),"K2",vtMissing); |
1340 |
Is it possible to assign a tooltip automatically to all bars, so it can display the start and end, without specifying the IexBarToolTip for each bar
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->GetBars()->GetItem("Task")->PutDef(EXG2ANTTLib::exBarToolTip,"<b><%=%9 + '/' + %C0%></b><br><upline><dotline>Start: <%=%1%><br>End: <%=%2%><br>Duration: <%=(%2-%1)%><br>Working: <%=%258%>"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Tasks A"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"K2",vtMissing); h = var_Items->AddItem("Tasks B"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(h,"Task",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,11,0,00,00).operator DATE(),"K2",vtMissing); |
1339 |
How can I change the color, font, bold etc for the items/cells in the same column or for the entire column
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IConditionalFormatPtr var_ConditionalFormat = spG2antt1->GetConditionalFormats()->Add(L"1",vtMissing); var_ConditionalFormat->PutBold(VARIANT_TRUE); var_ConditionalFormat->PutForeColor(RGB(255,0,0)); var_ConditionalFormat->PutApplyTo(EXG2ANTTLib::FormatApplyToEnum(0x1)); spG2antt1->GetColumns()->Add(L"C1"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"C2"))); var_Column->PutHeaderBold(VARIANT_TRUE); var_Column->PutHTMLCaption(L"<fgcolor=FF0000>C2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem(long(10)),long(1),long(11)); var_Items->PutCellValue(var_Items->AddItem(long(12)),long(1),long(13)); spG2antt1->EndUpdate(); |
1338 |
How can I remove a date-time zone
|
1337 |
How can I filter the check-boxes (method 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Check"))); EXG2ANTTLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXG2ANTTLib::CheckValueType); var_Editor->PutOption(EXG2ANTTLib::exCheckValue2,long(1)); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutCustomFilter(L"checked||-1|||unchecked||0"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(VARIANT_TRUE); var_Items->AddItem(VARIANT_TRUE); var_Items->AddItem(VARIANT_FALSE); var_Items->AddItem(VARIANT_TRUE); var_Items->AddItem(VARIANT_FALSE); var_Items->AddItem(VARIANT_TRUE); var_Items->AddItem(VARIANT_FALSE); |
1336 |
How can I filter the check-boxes (method 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Check"))); EXG2ANTTLib::IEditorPtr var_Editor = var_Column->GetEditor(); var_Editor->PutEditType(EXG2ANTTLib::CheckValueType); var_Editor->PutOption(EXG2ANTTLib::exCheckValue2,long(1)); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterType(EXG2ANTTLib::exCheck); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(VARIANT_TRUE); var_Items->AddItem(VARIANT_TRUE); var_Items->AddItem(VARIANT_FALSE); var_Items->AddItem(VARIANT_TRUE); var_Items->AddItem(VARIANT_FALSE); var_Items->AddItem(VARIANT_TRUE); var_Items->AddItem(VARIANT_FALSE); |
1335 |
How can add a button to control
// ButtonClick event - Occurs when user clicks on the cell's button. void OnButtonClickG2antt1(long Item,long ColIndex,VARIANT Key) { OutputDebugStringW( L"ButtonClick" ); /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( spG2antt1->GetItems()->GetCellCaption(Item,ColIndex) ); OutputDebugStringW( L"Key" ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(22); spG2antt1->PutHeaderHeight(22); spG2antt1->PutAppearance(EXG2ANTTLib::None2); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); spG2antt1->PutScrollBySingleLine(VARIANT_FALSE); spG2antt1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") + "lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" + "0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" + "NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="); spG2antt1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\auction.gif"); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Type"))); var_Column->PutWidth(48); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Appearance"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column1->PutAlignment(EXG2ANTTLib::CenterAlignment); var_Column1->PutHeaderAlignment(EXG2ANTTLib::CenterAlignment); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Items.<b>CellHasButton</b> property"); var_Items->PutCellValue(h,long(1),"Button <b>1</b>"); var_Items->PutCellHasButton(h,long(1),VARIANT_TRUE); h = var_Items->AddItem("Items.<b>CellButtonAutoWidth</b> property"); var_Items->PutCellValue(h,long(1)," Button <b>2</b> "); var_Items->PutCellHasButton(h,long(1),VARIANT_TRUE); var_Items->PutCellButtonAutoWidth(h,long(1),VARIANT_TRUE); h = var_Items->AddItem("Items.<b>CellHasButton</b> property"); var_Items->PutCellValue(h,long(1)," <img>2</img>Button <b>3</b> "); var_Items->PutCellHasButton(h,long(1),VARIANT_TRUE); var_Items->PutCellButtonAutoWidth(h,long(1),VARIANT_TRUE); h = var_Items->AddItem("Items.<b>CellHasButton</b> property"); var_Items->PutItemHeight(h,32); var_Items->PutCellValue(h,long(1)," <img>2</img>Button <b>4</b> <img>pic1</img> "); var_Items->PutCellHasButton(h,long(1),VARIANT_TRUE); var_Items->PutCellButtonAutoWidth(h,long(1),VARIANT_TRUE); h = var_Items->AddItem("Items.<b>CellHasButton</b> in splitted cells"); var_Items->PutCellValue(h,long(1)," Button <b>5.1</b> "); var_Items->PutCellHasButton(h,long(1),VARIANT_TRUE); var_Items->PutCellButtonAutoWidth(h,long(1),VARIANT_TRUE); _variant_t s = var_Items->GetSplitCell(h,long(1)); var_Items->PutCellValue(long(0),s," Button <b>5.2</b> "); var_Items->PutCellHasButton(long(0),s,VARIANT_TRUE); var_Items->PutCellButtonAutoWidth(long(0),s,VARIANT_TRUE); h = var_Items->AddItem("Column.<b>Editor</b>, Items.<b>CellEditor</b>"); var_Items->PutCellValue(h,long(1),"Visible when clicking the cell"); EXG2ANTTLib::IEditorPtr var_Editor = var_Items->GetCellEditor(h,long(1)); var_Editor->PutEditType(EXG2ANTTLib::EditType); var_Editor->AddButton("B1",long(1),long(0),"This is a bit of text that's shown when the cursor hovers the button B1",vtMissing,vtMissing); var_Editor->AddButton("B3",long(2),long(1),"This is a bit of text that's shown when the cursor hovers the button B3",vtMissing,vtMissing); var_Editor->AddButton("B4",long(1),long(1),"This is a bit of text that's shown when the cursor hovers the button B4",vtMissing,vtMissing); var_Editor->PutButtonWidth(24); h = var_Items->AddItem("Column.<b>Editor</b>, Items.<b>CellEditor</b>"); var_Items->PutCellValue(h,long(1),long(3)); EXG2ANTTLib::IEditorPtr var_Editor1 = var_Items->GetCellEditor(h,long(1)); var_Editor1->PutEditType(EXG2ANTTLib::CheckListType); var_Editor1->AddItem(1,L"Flag 1",vtMissing); var_Editor1->AddItem(2,L"Flag 2",vtMissing); var_Editor1->AddItem(4,L"Flag 4",vtMissing); var_Editor1->AddItem(8,L"Flag 8",vtMissing); var_Editor1->AddButton("C1",long(1),long(0),"This is a bit of text that's shown when the cursor hovers the button C1",vtMissing,vtMissing); var_Editor1->AddButton("C3",long(2),long(0),"This is a bit of text that's shown when the cursor hovers the button C2",vtMissing,vtMissing); var_Editor1->AddButton("C4",long(1),long(0),"This is a bit of text that's shown when the cursor hovers the button C3",vtMissing,vtMissing); var_Editor1->PutButtonWidth(24); spG2antt1->EndUpdate(); |
1334 |
Is it posible to store additional values against each item, cell, bar, link, such as custom values such string / numbers etc
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,96); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Column")))->PutData("Extra_Data_Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Item 1"); var_Items->PutItemData(h,"Extra_Data_Item 1"); var_Items->PutCellData(h,long(0),"Extra_Data_Item 1_Cell_0"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"B1",vtMissing); var_Items->PutItemBar(h,"B1",EXG2ANTTLib::exBarData,"Extra_B1_Data"); h = var_Items->AddItem("Item 2"); var_Items->PutItemData(h,"Extra_Data_Item 2"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"B2",vtMissing); var_Items->PutItemBar(h,"B2",EXG2ANTTLib::exBarData,"Extra_B2_Data"); var_Items->AddLink("L1",var_Items->GetFindItem("Item 1",long(0),vtMissing),"B1",var_Items->GetFindItem("Item 2",long(0),vtMissing),"B2"); var_Items->PutLink("L1",EXG2ANTTLib::exLinkUserData,"Extra_Link_Data"); |
1333 |
How do I set the parent item to show the total number of days for its children and also the minimum and maximum dates for its children
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); spG2antt1->PutIndent(11); spG2antt1->PutHasLines(EXG2ANTTLib::exSolidLine); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Tasks"); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Start")))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"End")))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Duration")))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(513)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutShowNonworkingDates(VARIANT_FALSE); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,220); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Project"); var_Items->AddBar(h,"Summary",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,10,3,0,00,00).operator DATE(),vtMissing,vtMissing); long h1 = var_Items->InsertItem(h,vtMissing,"Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,24,0,00,00).operator DATE(),vtMissing,vtMissing); long h2 = var_Items->InsertItem(h,vtMissing,"Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2006,9,24,0,00,00).operator DATE(),COleDateTime(2006,9,28,0,00,00).operator DATE(),vtMissing,vtMissing); long h3 = var_Items->InsertItem(h,vtMissing,"Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2006,9,28,0,00,00).operator DATE(),COleDateTime(2006,10,3,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->DefineSummaryBars(h,"",h1,""); var_Items->DefineSummaryBars(h,"",h2,""); var_Items->DefineSummaryBars(h,"",h3,""); var_Items->PutExpandItem(h,VARIANT_TRUE); var_Items->PutItemBold(h,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1332 |
Is it possible to specify the distance between 2 bars to be at least 2 working days
// BarResizing event - Occurs when a bar is moving or resizing. void OnBarResizingG2antt1(long Item,VARIANT Key) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->SchedulePDM(Item,Key); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(24); spG2antt1->PutAntiAliasing(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->Add(L"Task:Split"); var_Bar->PutShortcut(L"Task"); var_Bar->PutColor(RGB(0,0,0)); var_Bar->PutHeight(17); var_Bar->PutPattern(EXG2ANTTLib::exPatternFrameShadow); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,3,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutLinksWidth(2); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); var_Chart->PutNonworkingDaysPattern(EXG2ANTTLib::exPatternBDiagonal); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h1,"K1",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K2",vtMissing); var_Items->PutItemBar(h2,"K2",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->PutLink("L1",EXG2ANTTLib::exLinkShowRound,long(-1)); var_Items->PutLink("L1",EXG2ANTTLib::exLinkColor,long(8421504)); long h3 = var_Items->AddItem("Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutItemBar(h3,"K3",EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("L2",EXG2ANTTLib::exLinkText,"<br><br><br><br>This link <u>delays</u> the bars<br>with <b>2</b> working days"); var_Items->PutLink("L2",EXG2ANTTLib::exLinkPDMWorkingDelay,long(2)); var_Items->PutLink("L2",EXG2ANTTLib::exLinkShowRound,long(-1)); var_Items->SchedulePDM(0,"K1"); spG2antt1->EndUpdate(); |
1331 |
The item is not getting selected when clicking the cell's checkbox. What should I do
// CellStateChanged event - Fired after cell's state has been changed. void OnCellStateChangedG2antt1(long Item,long ColIndex) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->PutSelectItem(Item,VARIANT_TRUE); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Check")))->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(long(0)); var_Items->AddItem(long(1)); var_Items->AddItem(long(2)); var_Items->AddItem(long(3)); |
1330 |
How can I add a summary item as a child or subitem of another one
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->PutFirstVisibleDate(COleDateTime(2011,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); spG2antt1->GetColumns()->Add(L"Default"); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary = var_Items->AddItem("Project"); var_Items->AddBar(hSummary,"Summary",COleDateTime(2011,1,1,0,00,00).operator DATE(),COleDateTime(2011,1,1,0,00,00).operator DATE(),"Sum",vtMissing); long hChild = var_Items->InsertItem(hSummary,long(0),"Task 1"); var_Items->AddBar(hChild,"Task",COleDateTime(2011,1,2,0,00,00).operator DATE(),COleDateTime(2011,1,4,0,00,00).operator DATE(),"Task1",vtMissing); var_Items->DefineSummaryBars(hSummary,"Sum",hChild,"Task1"); hChild = var_Items->InsertItem(hSummary,long(0),"Task 2"); var_Items->AddBar(hChild,"Task",COleDateTime(2011,1,4,0,00,00).operator DATE(),COleDateTime(2011,1,6,0,00,00).operator DATE(),"Task2",vtMissing); var_Items->DefineSummaryBars(hSummary,"Sum",hChild,"Task2"); hChild = var_Items->InsertItem(hSummary,long(0),"Task 3"); var_Items->AddBar(hChild,"Task",COleDateTime(2011,1,6,0,00,00).operator DATE(),COleDateTime(2011,1,8,0,00,00).operator DATE(),"Task3",vtMissing); var_Items->DefineSummaryBars(hSummary,"Sum",hChild,"Task3"); var_Items->PutExpandItem(hSummary,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1329 |
How can I make an item a subitem of another one
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->GetColumns()->Add(L"Default"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary = var_Items->AddItem("Project"); long hChild = var_Items->InsertItem(hSummary,long(0),"Task 1"); hChild = var_Items->InsertItem(hSummary,long(0),"Task 2"); hChild = var_Items->InsertItem(hSummary,long(0),"Task 3"); var_Items->PutExpandItem(hSummary,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1328 |
Is it possible to move a bar per drag and drop to another owner/item
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Members")))->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutAllowSelectObjects(EXG2ANTTLib::exNoSelectObjects); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->GetBars()->GetItem("Task")->PutOverlaidType(EXG2ANTTLib::OverlaidBarsTypeEnum(EXG2ANTTLib::exOverlaidBarsIncludeCaption | EXG2ANTTLib::exOverlaidBarsStackAutoArrange | EXG2ANTTLib::exOverlaidBarsStack)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Member <b>1</b>"); var_Items->AddBar(h,"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,23,0,00,00).operator DATE(),"T102","Task <b>102</b>"); var_Items->PutItemBar(h,"T102",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"T102",EXG2ANTTLib::exBarCanMoveToAnother,VARIANT_TRUE); h = var_Items->AddItem("Member <b>2</b>"); h = var_Items->AddItem("Member <b>3</b>"); h = var_Items->AddItem("Member <b>4</b>"); var_Items->AddBar(h,"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,23,0,00,00).operator DATE(),"T103","Task <b>103</b>"); var_Items->PutItemBar(h,"T103",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->PutItemBar(h,"T103",EXG2ANTTLib::exBarCanMoveToAnother,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1327 |
I have the chart displaying days, is it possible to display bars/tasks up to hours so inside days somehow
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutUnitWidth(38); var_Chart->PutPaneWidth(VARIANT_FALSE,28); var_Chart->PutFirstVisibleDate(COleDateTime(2011,3,4,0,00,00).operator DATE()); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutResizeUnitScale(EXG2ANTTLib::exHour); spG2antt1->GetColumns()->Add(L"Default"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("ASS"),"Task",COleDateTime(2011,3,7,0,00,00).operator DATE(),COleDateTime(2011,3,7,3,30,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("EMB"),"Task",COleDateTime(2011,3,7,3,30,00).operator DATE(),COleDateTime(2011,3,8,9,15,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("TES"),"Task",COleDateTime(2011,3,8,9,15,00).operator DATE(),COleDateTime(2011,3,8,13,45,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1326 |
Is it possible to limit the height of the item while resizing
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->PutItemMinHeight(Item,18); spG2antt1->GetItems()->PutItemMaxHeight(Item,72); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutItemsAllowSizing(EXG2ANTTLib::exResizeItem); spG2antt1->PutScrollBySingleLine(VARIANT_FALSE); spG2antt1->PutBackColorAlternate(RGB(240,240,240)); spG2antt1->GetColumns()->Add(L"Names"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem("Mantel"); var_Items->AddItem("Mechanik"); var_Items->AddItem("Motor"); var_Items->AddItem("Murks"); var_Items->AddItem("Märchen"); var_Items->AddItem("Möhren"); var_Items->AddItem("Mühle"); spG2antt1->GetColumns()->GetItem(long(0))->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); |
1325 |
Is it possible to copy the hierarchy of the control using the GetItems method
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->GetColumns()->Add(L"Def"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); spG2antt1->PutItems(spG2antt1->GetItems(long(-1)),vtMissing); |
1324 |
I have found a property ReadOnly but this doesn't work correctly. I need the chart part of the control to be readonly too. Is it possible
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->PutReadOnly(EXG2ANTTLib::exReadOnly); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutBarsAllowSizing(VARIANT_FALSE); var_Chart->PutAllowLinkBars(VARIANT_FALSE); |
1323 |
How can I select a column
// MouseDown event - Occurs when the user presses a mouse button. void OnMouseDownG2antt1(short Button,short Shift,long X,long Y) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->GetItem(spG2antt1->GetColumnFromPoint(X,Y))->PutSelected(VARIANT_TRUE); spG2antt1->GetItems()->SelectAll(); spG2antt1->EndUpdate(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); spG2antt1->PutSingleSel(VARIANT_FALSE); spG2antt1->PutFullRowSelect(EXG2ANTTLib::exRectSel); spG2antt1->PutSortOnClick(EXG2ANTTLib::exNoSort); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Column1"); var_Columns->Add(L"Column2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellValue(var_Items->AddItem("One"),long(1),"One"); var_Items->PutCellValue(var_Items->AddItem("Two"),long(1),"Two"); spG2antt1->EndUpdate(); |
1322 |
I have several columns, but noticed that the filter is using AND between columns, but I need OR clause for filtering. Is it possible
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Item"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilter(L"Child 1"); var_Column->PutFilterType(EXG2ANTTLib::exFilter); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Date"))); var_Column1->PutDisplayFilterButton(VARIANT_TRUE); var_Column1->PutDisplayFilterPattern(VARIANT_FALSE); var_Column1->PutDisplayFilterDate(VARIANT_TRUE); var_Column1->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowExclude | EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox | EXG2ANTTLib::exNoItems)); var_Column1->PutFilter(L"COleDateTime(2010,12,28,0,00,00).operator DATE()"); var_Column1->PutFilterType(EXG2ANTTLib::exDate); spG2antt1->PutFilterCriteria(L"%0 or %1"); spG2antt1->PutDescription(EXG2ANTTLib::exFilterBarOr,L"<font ;18><fgcolor=FF0000>or</fgcolor></font>"); spG2antt1->PutDescription(EXG2ANTTLib::exFilterBarAnd,L"<font ;18><fgcolor=FF0000>and</fgcolor></font>"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->PutCellValue(var_Items->InsertItem(h,vtMissing,"Child 1"),long(1),COleDateTime(2010,12,27,0,00,00).operator DATE()); var_Items->PutCellValue(var_Items->InsertItem(h,vtMissing,"Child 2"),long(1),COleDateTime(2010,12,28,0,00,00).operator DATE()); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->PutCellValue(var_Items->InsertItem(h,vtMissing,"Child 1"),long(1),COleDateTime(2010,12,29,0,00,00).operator DATE()); var_Items->PutCellValue(var_Items->InsertItem(h,vtMissing,"Child 2"),long(1),COleDateTime(2010,12,30,0,00,00).operator DATE()); spG2antt1->ApplyFilter(); spG2antt1->EndUpdate(); |
1321 |
Is it possible exclude the dates being selected in the drop down filter window
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Date"))); var_Column->PutSortType(EXG2ANTTLib::SortDate); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutDisplayFilterDate(VARIANT_TRUE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowExclude | EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox | EXG2ANTTLib::exNoItems)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(COleDateTime(2010,12,27,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,28,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,29,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,30,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,31,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1320 |
How can I display a calendar control inside the drop down filter window
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Date"))); var_Column->PutSortType(EXG2ANTTLib::SortDate); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutDisplayFilterDate(VARIANT_TRUE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox | EXG2ANTTLib::exNoItems)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(COleDateTime(2010,12,27,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,28,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,29,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,30,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,31,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1319 |
Is it possible to include the dates as checkb-boxes in the drop down filter window
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Dates"))); var_Column->PutSortType(EXG2ANTTLib::SortDate); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_TRUE); var_Column->PutDisplayFilterDate(VARIANT_TRUE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox)); var_Column->PutFilter(L"to 12/27/2010"); var_Column->PutFilterType(EXG2ANTTLib::exDate); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(COleDateTime(2010,12,27,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,28,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,29,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,30,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,31,0,00,00).operator DATE()); spG2antt1->ApplyFilter(); spG2antt1->EndUpdate(); |
1318 |
How can I filter items for dates before a specified date
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Dates"))); var_Column->PutSortType(EXG2ANTTLib::SortDate); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_TRUE); var_Column->PutDisplayFilterDate(VARIANT_TRUE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exNoItems)); var_Column->PutFilter(L"to 12/27/2010"); var_Column->PutFilterType(EXG2ANTTLib::exDate); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(COleDateTime(2010,12,27,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,28,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,29,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,30,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,31,0,00,00).operator DATE()); spG2antt1->ApplyFilter(); spG2antt1->EndUpdate(); |
1317 |
Is it possible to filter dates
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Dates"))); var_Column->PutSortType(EXG2ANTTLib::SortDate); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_TRUE); var_Column->PutDisplayFilterDate(VARIANT_TRUE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exNoItems)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(COleDateTime(2010,12,27,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,28,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,29,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,30,0,00,00).operator DATE()); var_Items->AddItem(COleDateTime(2010,12,31,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1316 |
Is it possible to change the Exclude field name to something different, in the drop down filter window
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->PutDescription(EXG2ANTTLib::exFilterBarExclude,L"Leaving out"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowExclude | EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); spG2antt1->EndUpdate(); |
1315 |
How can I display the Exclude field in the drop down filter window
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowExclude | EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); spG2antt1->EndUpdate(); |
1314 |
Is it possible to show and ensure the focused item from the control, in the drop down filter window
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowFocusItem | EXG2ANTTLib::exShowCheckBox)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->PutSelectItem(var_Items->InsertItem(h,vtMissing,"Child 2"),VARIANT_TRUE); var_Items->PutExpandItem(h,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1313 |
Is it possible to show only blanks items with no listed items from the control
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowBlanks | EXG2ANTTLib::exNoItems)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); spG2antt1->EndUpdate(); |
1312 |
How can I include the blanks items in the drop down filter window
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowBlanks | EXG2ANTTLib::exShowCheckBox)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); spG2antt1->EndUpdate(); |
1311 |
How can I select multiple items in the drop down filter window, using check-boxes
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterList(EXG2ANTTLib::exShowCheckBox); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); spG2antt1->EndUpdate(); |
1310 |
Is it possible to allow a single item being selected in the drop down filter window
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterList(EXG2ANTTLib::exSingleSel); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); spG2antt1->EndUpdate(); |
1309 |
How can I display no (All) item in the drop down filter window
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->PutDescription(EXG2ANTTLib::exFilterBarAll,L""); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_TRUE); var_Column->PutFilterList(EXG2ANTTLib::exNoItems); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); spG2antt1->EndUpdate(); |
1308 |
Is it possible to display no items in the drop down filter window, so only the pattern is visible
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_TRUE); var_Column->PutFilterList(EXG2ANTTLib::exNoItems); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); spG2antt1->EndUpdate(); |
1307 |
How can I specify the time-scale available when zoom-in/zoom-out or enlarging the chart
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutShowNonworkingDates(VARIANT_FALSE); var_Chart->PutLevelCount(3); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutAllowResizeChart(EXG2ANTTLib::ResizeChartEnum(EXG2ANTTLib::exAllowChangeUnitScale | EXG2ANTTLib::exAllowResizeChartMiddle | EXG2ANTTLib::exAllowResizeChartHeader)); var_Chart->PutLabel(EXG2ANTTLib::exHour,L""); var_Chart->PutLabel(EXG2ANTTLib::exMinute,L""); var_Chart->PutLabel(EXG2ANTTLib::exSecond,L""); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B"),"Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task C"),"Task",COleDateTime(2001,1,10,0,00,00).operator DATE(),COleDateTime(2001,1,14,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem(""),"",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"Info","Click the <b>middle</b> mouse button and start dragging"); spG2antt1->EndUpdate(); |
1306 |
How can I enable zoom-in/zoom-out or enlarging the chart, using the mouse middle button
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutShowNonworkingDates(VARIANT_FALSE); var_Chart->PutLevelCount(3); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutAllowResizeChart(EXG2ANTTLib::ResizeChartEnum(EXG2ANTTLib::exAllowChangeUnitScale | EXG2ANTTLib::exAllowResizeChartMiddle | EXG2ANTTLib::exAllowResizeChartHeader)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B"),"Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task C"),"Task",COleDateTime(2001,1,10,0,00,00).operator DATE(),COleDateTime(2001,1,14,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem(""),"",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"Info","Click the <b>middle</b> mouse button and start dragging"); spG2antt1->EndUpdate(); |
1305 |
How can I enable zoom-in/zoom-out or enlarging, using the chart's header
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutShowNonworkingDates(VARIANT_FALSE); var_Chart->PutLevelCount(3); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutAllowResizeChart(EXG2ANTTLib::ResizeChartEnum(EXG2ANTTLib::exAllowChangeUnitScale | EXG2ANTTLib::exAllowResizeChartHeader)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B"),"Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task C"),"Task",COleDateTime(2001,1,10,0,00,00).operator DATE(),COleDateTime(2001,1,14,0,00,00).operator DATE(),"K1",vtMissing); spG2antt1->EndUpdate(); |
1304 |
How can I enable resizing the chart, using the mouse middle button
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutShowNonworkingDates(VARIANT_FALSE); var_Chart->PutLevelCount(3); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutAllowResizeChart(EXG2ANTTLib::ResizeChartEnum(EXG2ANTTLib::exAllowResizeChartMiddle | EXG2ANTTLib::exAllowResizeChartHeader)); var_Chart->PutMaxUnitWidth(128); var_Chart->PutMinUnitWidth(8); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B"),"Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task C"),"Task",COleDateTime(2001,1,10,0,00,00).operator DATE(),COleDateTime(2001,1,14,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem(""),"",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"Info","Click the <b>middle</b> mouse button and start dragging"); spG2antt1->EndUpdate(); |
1303 |
How can I enable resizing the chart, using the chart's header
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutShowNonworkingDates(VARIANT_FALSE); var_Chart->PutLevelCount(3); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->PutAllowResizeChart(EXG2ANTTLib::exAllowResizeChartHeader); var_Chart->PutMaxUnitWidth(128); var_Chart->PutMinUnitWidth(8); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B"),"Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task C"),"Task",COleDateTime(2001,1,10,0,00,00).operator DATE(),COleDateTime(2001,1,14,0,00,00).operator DATE(),"K1",vtMissing); spG2antt1->EndUpdate(); |
1302 |
Is it possible to auto-numbering the children items but still keeps the position after filtering
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Items"))); var_Column->PutDisplayFilterButton(VARIANT_TRUE); var_Column->PutFilterType(EXG2ANTTLib::exFilter); var_Column->PutFilter(L"Child 2"); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.1"))); var_Column1->PutFormatColumn(L"1 ropos ''"); var_Column1->PutPosition(0); var_Column1->PutWidth(32); var_Column1->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column2 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.2"))); var_Column2->PutFormatColumn(L"1 ropos ':'"); var_Column2->PutPosition(1); var_Column2->PutWidth(32); var_Column2->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column3 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.3"))); var_Column3->PutFormatColumn(L"1 ropos ':|A-Z'"); var_Column3->PutPosition(2); var_Column3->PutWidth(32); var_Column3->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column4 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.4"))); var_Column4->PutFormatColumn(L"1 ropos '|A-Z|'"); var_Column4->PutPosition(3); var_Column4->PutWidth(32); var_Column4->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column5 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.5"))); var_Column5->PutFormatColumn(L"'<font Tahoma;7>' + 1 ropos '-<b>||A-Z'"); var_Column5->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column5->PutPosition(4); var_Column5->PutWidth(32); var_Column5->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column6 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.6"))); var_Column6->PutFormatColumn(L"'<b>'+ 1 ropos '</b>:<fgcolor=FF0000>|A-Z|'"); var_Column6->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column6->PutPosition(5); var_Column6->PutWidth(48); var_Column6->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); spG2antt1->ApplyFilter(); spG2antt1->EndUpdate(); |
1301 |
Is it possible to auto-numbering the children items too
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->GetColumns()->Add(L"Items"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.1"))); var_Column->PutFormatColumn(L"1 rpos ''"); var_Column->PutPosition(0); var_Column->PutWidth(32); var_Column->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.2"))); var_Column1->PutFormatColumn(L"1 rpos ':'"); var_Column1->PutPosition(1); var_Column1->PutWidth(32); var_Column1->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column2 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.3"))); var_Column2->PutFormatColumn(L"1 rpos ':|A-Z'"); var_Column2->PutPosition(2); var_Column2->PutWidth(32); var_Column2->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column3 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.4"))); var_Column3->PutFormatColumn(L"1 rpos '|A-Z|'"); var_Column3->PutPosition(3); var_Column3->PutWidth(32); var_Column3->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column4 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.5"))); var_Column4->PutFormatColumn(L"'<font Tahoma;7>' + 1 rpos '-<b>||A-Z'"); var_Column4->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column4->PutPosition(4); var_Column4->PutWidth(32); var_Column4->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column5 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Pos.6"))); var_Column5->PutFormatColumn(L"'<b>'+ 1 rpos '</b>:<fgcolor=FF0000>|A-Z|'"); var_Column5->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column5->PutPosition(5); var_Column5->PutWidth(48); var_Column5->PutAllowSizing(VARIANT_FALSE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); spG2antt1->EndUpdate(); |